import React, { Component } from 'react'
import { ListBox } from '../../../components'


import { fetchData } from '../../../components/AjaxConsumer'
import { Button, Modal, Form, Input, Radio, Upload, Icon } from 'antd';
export default class ListProCountingDifference extends Component {
    constructor(props) {
        super(props);
        this.state = {
            tableColumn: {},
            searchComponentData: [],
            visible: false,
        };
        //行操作列表
        this.rowOperation = [

        ];
        //header 操作列表
        this.headerOperation = [

        ];

        //table列表展示列配置
        //showName、columnName 必有属性， columnWidth 可选，默认100, columnHidden: true 列隐藏
        this.tableColumn = {
            storageKey: 'listLockLog',
            data: [
                {
                    showName: 'lockLogId',
                    columnName: 'lockLogId',
                    columnHidden: true,
                    foreverHidden: true
                }, {
                    showName: '盘点单号',
                    columnName: 'countingCode',
                    columnWidth: 120
                }, {
                    showName: '合同编号',
                    columnName: 'contractNo',
                    columnWidth: 140
                }, {
                    showName: '条码',
                    columnName: 'proBarcode',
                    columnWidth: 160
                }, {
                    showName: '型号',
                    columnName: 'model',
                    columnWidth: 140
                }, {
                    showName: '型号描述',
                    columnName: 'modelDesc'
                }, {
                    showName: '差异类型',
                    columnName: 'differType',
                    showOption: [//页面显示配置
                        {
                            optionKey: '0',
                            optionShow: '盘盈'
                        }, {
                            optionKey: '1',
                            optionShow: '盘亏'
                        }
                    ]
                },{
                    showName: '盘点时间',
                    columnName: 'countingTime',
                    columnWidth: 140
                },
                // {
                //     showName: '差异状态',
                //     columnName: 'differStatus',
                //     showOption: [//页面显示配置
                //         {
                //             optionKey: '0',
                //             optionShow: '未处理'
                //         }, {
                //             optionKey: '1',
                //             optionShow: '已处理'
                //         }
                //     ]
                // }, {
                //     showName: '调整方式',
                //     columnName: 'adjustMethod',
                //     showOption: [//页面显示配置
                //         {
                //             optionKey: '0',
                //             optionShow: '手工调整'
                //         }
                //         // , {
                //         //     optionKey: '1',
                //         //     optionShow: '已处理'
                //         // }
                //     ]
                // }, {
                //     showName: '调整人',
                //     columnName: 'adjustBy'
                // }, 
                // {
                //     showName: ' 仓库',
                //     columnName: 'whCode'
                // }, {
                //     showName: ' 区域',
                //     columnName: 'wdCode'
                // }, {
                //     showName: ' 库区',
                //     columnName: 'waCode'
                // },
                {
                    showName: ' 库位',
                    columnName: 'wlCode'
                }, {
                    showName: ' 保管员',
                    columnName: 'keepBy'
                }
            ]
        };

        //搜索属性配置
        this.searchComponentData = [
            {
                showName: '差异类型',
                name: 'differType',
                type: 'select',
                optionList: [
                    {
                        optionKey: '',
                        optionShow: ''
                    },
                    {
                        optionKey: '0',
                        optionShow: '盘盈'
                    }, {
                        optionKey: '1',
                        optionShow: '盘亏'
                    }
                ]
            }, {
                showName: '差异状态',
                name: 'differStatus',
                type: 'select',
                optionList: [
                    {
                        optionKey: '',
                        optionShow: ''
                    }, {
                        optionKey: '0',
                        optionShow: '未处理'
                    }, {
                        optionKey: '1',
                        optionShow: '已处理'
                    }
                ]
            }, {
                showName: '调整方式',
                name: 'adjustMethod',
                type: 'select',
                optionList: [
                    {
                        optionKey: '',
                        optionShow: ''
                    }, {
                        optionKey: '0',
                        optionShow: '手工调整'
                    }
                ]
            }
            , {
                name: 'countingTime',
                type: 'date',
                maxName: 'countingTimeMax',
                minName: 'countingTimeMin',
                showTime: '1'
            }
            //,{
            //     name:'gmtModified',
            //     type: 'date',
            //     maxName:'gmtModifiedMax',
            //     minName:'gmtModifiedMin'
            // }
        ];

    }

    rowHandles = (strHandles, rowObj) => {
    }






    //刷新列表
    refreshHandle = () => {
        this.refs.listWorkarea.refreshHandle();
    }

    componentWillMount() {

    }




    render() {
        //当左侧隐藏时，列表宽度加上左侧的宽度，
        //1、当前this.props.isHideLeft 是从页面组件containers/Main/main.js传过来
        //2、this.props.isHideLeft 最顶级赋值是在页面 containers/Main/main.js
        let isHideLeft = this.props.isHideLeft;

        return (
            <div>
                <ListBox
                    ref='ListProCountingDifference'
                    title="成品盘点差异"
                    isHideLeft={isHideLeft}
                    tableColumnData={this.tableColumn}
                    searchComponentData={this.searchComponentData}
                    url='/product/proCountingDifference/list'
                    rowHandles={this.rowHandles}
                    rowOperation={this.rowOperation}
                    headerOperation={this.headerOperation}
                    isRowSingle="true"
                />
            </div>
        )
    }
}
